package com.aya.simple.handler;

import org.springframework.stereotype.Controller;
import org.springframework.web.HttpRequestHandler;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 通过如下方式访问，会匹配  org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping
 * http://localhost:8080/httprequest
 */
@Controller("/httprequest")
public class CustomHttpRequestHandler implements HttpRequestHandler {
    @Override
    public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.getWriter().println("CustomHttpRequestHandler handleRequest，无法返回视图解析器");
    }
}
